package com.axonactive;

import java.util.List;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;

import com.axonactive.entities.Book;

@Named
@RequestScoped
public class BookBean {
	private Book book;
	
	@Inject
	private BookBeanService bookService;
	public List<Book> getBooks(){
		return bookService.getBooks();
	}
	
	public void saveBook(){	
		bookService.saveBook(book);
	}
	public Book getBook() {	
		if(book==null){
			book = new Book();
		}
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}
	
}
